diff options
| author | Adam Soltys <[email protected]> | 2022-09-13 23:18:40 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-13 23:18:40 -0700 |
| commit | dfe32780e0862515eb4b2ddebae9fcfb2198704a (patch) | |
| tree | f8b463ccc51291393c71cc3c95ca3725c74d341b /src/routes/[username]/transactions | |
| parent | cfdc6ed4a98e1eb60aba653d4403138a8fcaa4c2 (diff) | |
| download | coinos-ui-dfe32780e0862515eb4b2ddebae9fcfb2198704a.tar.gz coinos-ui-dfe32780e0862515eb4b2ddebae9fcfb2198704a.zip | |
currency formatting helpers
Diffstat (limited to 'src/routes/[username]/transactions')
| -rw-r--r-- | src/routes/[username]/transactions/+page.svelte | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/routes/[username]/transactions/+page.svelte b/src/routes/[username]/transactions/+page.svelte index 9bc67fda..5a132394 100644 --- a/src/routes/[username]/transactions/+page.svelte +++ b/src/routes/[username]/transactions/+page.svelte @@ -2,6 +2,7 @@ import { AppHeader } from '$comp'; import { user, newPayment } from '$lib/store'; import { t } from '$lib/translations'; + import { f, s } from "$lib/utils"; $newPayment = false; @@ -28,16 +29,11 @@ <div class="grid grid-cols-3 border-b pb-5"> <div class="font-bold"> <span class="block mb-1" - >{tx.amount > 0 ? '+' : ''}{new Intl.NumberFormat('en-US', { - style: 'currency', - currency: tx.currency - }).format(tx.amount * (tx.rate / 100000000))} + >{tx.amount > 0 ? '+' : ''}{f(tx.amount * (tx.rate / 100000000), tx.currency)} </span> <span class="text-secondary" - >{tx.amount > 0 ? '+' : ''}{new Intl.NumberFormat('en-US', { - maximumFractionDigits: 0 - }).format(tx.amount)} + >{tx.amount > 0 ? '+' : ''}{s(tx.amount)} SAT </span> </div> |
